import { Component } from '@angular/core';

//NavController就是用来管理和导航页面的一个controlle
import { NavController } from 'ionic-angular';


import { ModalController } from 'ionic-angular';
import { ViewController } from 'ionic-angular';
//导入more 的界面
import { MorePage } from '../more/more';
import { List1Page } from '../list/list1/list1';
import { List2Page } from '../list/list2/list2';
import { List3Page } from '../list/list3/list3';


//表单
import { FormPage } from '../form/form';


//网络请求
import { WebPage } from '../web/web';

// 下拉刷新
import { RefreshPage } from '../refresh/refresh'

// 侧滑菜单
import { MenuPage } from '../menu/menu'

//用户登录
import { LoginPage } from '../login/login';
//下拉菜单
import { SheetPage } from '../sheet/sheet';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

//暴漏HomePage组建
export class HomePage {
  //定义一个属性
  morePage;

  //注入一个NavController的实例.
  constructor(
    public navCtrl: NavController,
    public modalCtrl: ModalController,
    public viewCtrl:ViewController) {
    this.morePage = MorePage;
  }
   
  //通过代码的方式跳转
  pushMorePage(){
    console.log("代码方式跳转");
   
    //跳转到指定页面， 后面的集合是一个参数
    this.navCtrl.push(MorePage,{
      title:'我是上一个界面搞来的'
    });
  }

  //跳转到list界面
  pushList1Page(){
    this.navCtrl.push(List1Page)
  }

  //复杂一点的列表
  pushList2Page(){
    this.navCtrl.push(List2Page)
  }

  pushList3Page(){
    this.navCtrl.push(List3Page)
  }

  pushFormPage(){
    this.navCtrl.push(FormPage);
  }

  pushWebPage(){
    //跳转到web那个页面
    this.navCtrl.push(WebPage);
  }

  pushRefreshPage(){
      //跳转到下拉刷新那个页面
      this.navCtrl.push(RefreshPage); 
  }
  
  pushMenuPage(){
    //let modal =this.modalCtrl.create(MenuPage);
    // this.viewCtrl.dismiss();
    
    //侧滑菜单
    this.navCtrl.push(MenuPage); 
    //modal.present();
  }


  pushSheetPage(){
    this.navCtrl.push(SheetPage);
  }

  pushLoginPage(){
    this.navCtrl.push(LoginPage);
    
  }
}
